 <ui:composition template="#{template}" xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
  
<ui:define name="title">Templates</ui:define>
  
	<ui:define name="content">
	
	<div>
  
	 <h3>
	 TEMPLATES (#{templateManager.size})
	 </h3>
	 	 
</div>

<h:outputScript library="js" name="jquery-1.4.2.min.js"/>
<h:outputScript library="js" name="app.js"/>


<div style="margin-left:auto;margin-right:auto;width:100%">


<table border="0" width="100%" cellpadding="8" cellspacing="8">

<tbody>

<tr>

<td align="center">

<h:form>
	<h:dataTable value="#{templateManager.templates}" var="template"  border="0" cellpadding="5" cellspacing="3"  dir="LTR"  
	style="margin-left:auto;margin-right:auto;width:100%;margin-top:5px;font-size:12px;">
		
		<h:column>
			<f:facet name="header">
			<h:outputText value="#"/>
			</f:facet>
			<h:outputText value="#{template.index}"/>
		</h:column>
		
		<h:column>
			<f:facet name="header">
			<h:outputText value="Name"/>
			</f:facet>
			<h:link value="#{template.name}" outcome="templates"  styleClass="template_name">
				<h:graphicImage  width="200px" height="150px" library="#{template.id}" name="template.png" styleClass="thumbnail"/>
				<f:param name="template" value="#{template.id}"/>
			</h:link>
		</h:column>
 		
 		<h:column>
			<f:facet name="header">
			<h:outputText value="Version"/>
			</f:facet>
			<h:outputText value="#{template.version}"/>
		</h:column>
 		
 		<h:column>
			<f:facet name="header">
			<h:outputText value="Author"/>
			</f:facet>
			<h:outputText value="#{template.author}"/>
		</h:column>
 		
 		<h:column>
			<f:facet name="header">
			<h:outputText value="License"/>
			</f:facet>
			<h:outputText value="#{template.license}"/>
		</h:column>
 		
		<h:column>
			<f:facet name="header">
			<h:outputText value="Details"/>
			</f:facet>
			<h:link value="see" outcome="templateDetails">
			 	<f:param name="template" value="#{template.id}"/>
			</h:link>
		</h:column>
		
		<h:column>
			<f:facet name="header">
			<h:outputText value="Download"/>
			</f:facet>
			<a href="#{facesContext.externalContext.request.contextPath}/services/templates/#{template.index}/download">
			   download
			</a>
		</h:column>
		
		
	</h:dataTable>
 </h:form>	

</td>

</tr>

</tbody>

</table>
 
 </div>
	
	</ui:define>
      
      </ui:composition>        
             